﻿#region copyright
// Halcyone - Silverlight Application Framework
// Copyright (C) 2009 - 2010 Alexey Zakharov (B&Z LLC)
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#endregion
namespace Witcraft.Halcyone.ServiceModel
{
    using System;

    /// <summary>
    /// 
    /// </summary>
    public class HttpPostAttribute : RestMethodAttribute
    {
        #region Constructors and Destructors

        /// <summary>
        /// 
        /// </summary>
        public HttpPostAttribute()
        {
            this.Method = HttpVerbs.POST;
        }

        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    public class HttpGetAttribute : RestMethodAttribute
    {
        #region Constructors and Destructors

        /// <summary>
        /// 
        /// </summary>
        public HttpGetAttribute()
        {
            this.Method = HttpVerbs.GET;
        }

        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    public class HttpDeleteAttribute : RestMethodAttribute
    {
        #region Constructors and Destructors

        /// <summary>
        /// 
        /// </summary>
        public HttpDeleteAttribute()
        {
            this.Method = HttpVerbs.DELETE;
        }

        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    public class HttpPutAttribute : RestMethodAttribute
    {
        #region Constructors and Destructors

        /// <summary>
        /// 
        /// </summary>
        public HttpPutAttribute()
        {
            this.Method = HttpVerbs.PUT;
        }

        #endregion
    }

    /// <summary>
    /// 
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class RestMethodAttribute : Attribute
    {
        #region Properties

        /// <summary>
        /// 
        /// </summary>
        public HttpVerbs Method { get; set; }

        #endregion
    }
}
